-----------
-- OHMNA --
-----------
local Locales = {
	["Dreadphage Ohmna"] = {
		[1] = "Dreadphage Ohmna",
		[2] = "Schreckensphage Ohmna",
		[3] = "Ohmna la Terriphage",
	},
	["Body Slam"] = { -- 72662
		[1] = "Body Slam",
		[2] = "Bodyslam",
		[3] = "Coup corporel",
	},
	["Devour"] = { -- 60925
		[1] = "Devour",
		[2] = "Verschlingen",
		[3] = "Dévorer",
	},
	["Genetic Torrent"] = { -- 72663
		[1] = "Genetic Torrent",
		[2] = "Genetische Strömung",
		[3] = "Torrent génétique",
	},
}

local function GAOhmna(tUnits)
	local currTime = GameLib.GetGameTime()
	for unitid, unitdata in pairs(tUnits) do
		local unitname = unitdata.unit:GetName()
		if unitname == Raiderino.L["Dreadphage Ohmna"] then
			local castname = Raiderino:GetCast(unitid,unitdata.unit)
			if castname then
				if castname == Raiderino.L["Body Slam"] then
					if Raiderino:FeatureCheck("Dreadphage Ohmna","Body Slam") then
						local msg = {text = "Body Slam", maxtime = 84, icon = nil, destroyAtEnd = true}
						Raiderino.timers:AddTimer(msg)
					end
				elseif castname == Raiderino.L["Devour"] then
					if Raiderino:FeatureCheck("Dreadphage Ohmna","Devour") then
						local msg = {text = "Devour", maxtime = 25.5, icon = nil, destroyAtEnd = true}
						Raiderino.timers:AddTimer(msg)
					end
				elseif castname == Raiderino.L["Genetic Torrent"] then
					if Raiderino:FeatureCheck("Dreadphage Ohmna","Genetic Torrent") then
						local msg = {text = "Genetic Torrent", maxtime = 84, icon = nil, destroyAtEnd = true}
						Raiderino.timers:AddTimer(msg)
					end
				else
					Raiderino:UntimedCastAdd(unitname,castname)
				end
			end
		end
	end
end

local function PhaseOhmna(phase)

end

local function StartOhmna()

end
------------
-- /OHMNA --
------------

local encounteroptions = {
	enabled = true,
	position = 13,
	zone = "Genetic Archives - Act 2",
	fBossFunction = GAOhmna,
	fPhaseFunction = PhaseOhmna,
	fOnStartCombat = StartOhmna,
	features = {
		["Body Slam"] = {
			displayname = "Body Slam",
			enabled = true
		},
		["Devour"] = {
			displayname = "Devour",
			enabled = true
		},
		["Genetic Torrent"] = {
			displayname = "Genetic Torrent",
			enabled = true
		},
	},
}

if _G["RaiderinoLibs"] == nil then
	_G["RaiderinoLibs"] = { }
end
if _G["RaiderinoLibs"]["Encounters"] == nil then
	_G["RaiderinoLibs"]["Encounters"] = { }
end

_G["RaiderinoLibs"]["Encounters"]["Dreadphage Ohmna"] = encounteroptions

if _G["RaiderinoLibs"]["Locales"] == nil then
	_G["RaiderinoLibs"]["Locales"] = { }
end
for locale, localedata in pairs(Locales) do
	if not RaiderinoLibs.Locales[locale] then
		RaiderinoLibs.Locales[locale] = {}
		for i,localestring in pairs(localedata) do
			RaiderinoLibs.Locales[locale][i] = localestring
		end
	end
end